Only clear the triangle below the grip to the background, not the full
authorMatthias Clasen <mclasen@redhat.com>
Tue, 9 Nov 2004 14:49:01 +0000 (14:49 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 9 Nov 2004 14:49:01 +0000 (14:49 +0000)
2004-11-09  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkstyle.c (gtk_default_draw_resize_grip): Only
clear the triangle below the grip to the background,
not the full area.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkstyle.c

index 59907ad3a227bdfbb643c1e3fafac6864b6d9939..05552b823b25fe539b7f413432d2187311655804 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstyle.c (gtk_default_draw_resize_grip): Only
+       clear the triangle below the grip to the background,
+       not the full area.
+
        * gtk/gtklabel.c (draw_insertion_cursor, gtk_label_expose): 
        Clip when drawing the cursor. This prevents bits of a
        selectable label leaking out from underneath the resize
index 59907ad3a227bdfbb643c1e3fafac6864b6d9939..05552b823b25fe539b7f413432d2187311655804 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstyle.c (gtk_default_draw_resize_grip): Only
+       clear the triangle below the grip to the background,
+       not the full area.
+
        * gtk/gtklabel.c (draw_insertion_cursor, gtk_label_expose): 
        Clip when drawing the cursor. This prevents bits of a
        selectable label leaking out from underneath the resize
index 59907ad3a227bdfbb643c1e3fafac6864b6d9939..05552b823b25fe539b7f413432d2187311655804 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstyle.c (gtk_default_draw_resize_grip): Only
+       clear the triangle below the grip to the background,
+       not the full area.
+
        * gtk/gtklabel.c (draw_insertion_cursor, gtk_label_expose): 
        Clip when drawing the cursor. This prevents bits of a
        selectable label leaking out from underneath the resize
index 59907ad3a227bdfbb643c1e3fafac6864b6d9939..05552b823b25fe539b7f413432d2187311655804 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkstyle.c (gtk_default_draw_resize_grip): Only
+       clear the triangle below the grip to the background,
+       not the full area.
+
        * gtk/gtklabel.c (draw_insertion_cursor, gtk_label_expose): 
        Clip when drawing the cursor. This prevents bits of a
        selectable label leaking out from underneath the resize
index 4a6964090c81db6deafbc2255e785b06c1b12942..225174c057dd68d1323b531c53b36f01b786ee90 100644 (file)
@@ -5312,6 +5312,9 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
                               gint            width,
                               gint            height)
 {
+  GdkPoint points[4];
+  gint i, j, skip;
+
   g_return_if_fail (GTK_IS_STYLE (style));
   g_return_if_fail (window != NULL);
   
@@ -5322,42 +5325,35 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
       gdk_gc_set_clip_rectangle (style->bg_gc[state_type], area);
     }
   
+  skip = -1;
   switch (edge)
     {
     case GDK_WINDOW_EDGE_NORTH_WEST:
       /* make it square */
       if (width < height)
-       {
-         height = width;
-       }
+       height = width;
       else if (height < width)
-       {
-         width = height;
-       }
+       width = height;
+      skip = 2;
       break;
     case GDK_WINDOW_EDGE_NORTH:
       if (width < height)
-       {
-         height = width;
-       }
+       height = width;
       break;
     case GDK_WINDOW_EDGE_NORTH_EAST:
       /* make it square, aligning to top right */
       if (width < height)
-       {
-         height = width;
-       }
+       height = width;
       else if (height < width)
        {
          x += (width - height);
          width = height;
        }
+      skip = 3;
       break;
     case GDK_WINDOW_EDGE_WEST:
       if (height < width)
-       {
-          width = height;
-       }
+       width = height;
       break;
     case GDK_WINDOW_EDGE_EAST:
       /* aligning to right */
@@ -5375,9 +5371,8 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
          height = width;
        }
       else if (height < width)
-       {
-         width = height;
-       }
+       width = height;
+      skip = 1;
       break;
     case GDK_WINDOW_EDGE_SOUTH:
       /* align to bottom */
@@ -5399,15 +5394,26 @@ gtk_default_draw_resize_grip (GtkStyle       *style,
          x += (width - height);
          width = height;
        }
+      skip = 0;
       break;
     default:
       g_assert_not_reached ();
     }
   /* Clear background */
-  gtk_style_apply_default_background (style, window, FALSE,
-                                     state_type, area,
-                                     x, y, width, height);   
-
+  j = 0;
+  for (i = 0; i < 4; i++)
+    {
+      if (skip != i)
+       {
+         points[j].x = (i == 0 || i == 3) ? x : x + width;
+         points[j].y = (i < 2) ? y : y + height;
+         j++;
+       }
+    }
+  
+  gdk_draw_polygon (window, style->bg_gc[state_type], TRUE, 
+                   points, skip < 0 ? 4 : 3);
+  
   switch (edge)
     {
     case GDK_WINDOW_EDGE_WEST: